import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//   普通路由
export const constantRouts = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/Register.vue')
  },
]

// 带权限的路由
export const asyncRoutes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/Home.vue')
  },
  {
    path: '/dashboard',
    name: 'dashboard',
    component: () => import('@/views/Dashboard.vue')
  }
]


const router = new VueRouter({
  routes: constantRouts
})

export default router
